/*
 * Created by JFormDesigner on Tue May 13 23:26:57 CST 2025
 */

package com.soft.bams.server;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * @author 23838
 */
public class ServerPanel extends JPanel {
    public ServerPanel() {
        initComponents();
    }

    private void start(ActionEvent e) {
        // TODO add your code here
    }

    private void close(ActionEvent e) {
        // TODO add your code here
    }

    //跳转至RankPanel界面
    private void skipRank(ActionEvent e) {
        CardLayout card = (CardLayout)this.getParent().getLayout();
        card.show(this.getParent() , "rank");
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        label1 = new JLabel();
        startbutton = new JButton();
        closebutton = new JButton();
        skipRankbutton = new JButton();

        //======== this ========
        setLayout(null);

        //---- label1 ----
        label1.setText("\u670d  \u52a1  \u5668");
        label1.setHorizontalAlignment(SwingConstants.CENTER);
        label1.setFont(new Font("Microsoft YaHei UI", Font.BOLD, 28));
        add(label1);
        label1.setBounds(210, 25, 120, 50);

        //---- startbutton ----
        startbutton.setText("\u542f\u52a8");
        startbutton.addActionListener(e -> start(e));
        add(startbutton);
        startbutton.setBounds(105, 170, 120, 45);

        //---- closebutton ----
        closebutton.setText("\u5173\u95ed");
        closebutton.addActionListener(e -> close(e));
        add(closebutton);
        closebutton.setBounds(310, 165, 120, 45);

        //---- skipRankbutton ----
        skipRankbutton.setText("\u5f00\u542f\u4e0a\u5e1d\u89c6\u89d2");
        skipRankbutton.addActionListener(e -> skipRank(e));
        add(skipRankbutton);
        skipRankbutton.setBounds(190, 290, 160, 45);

        setPreferredSize(new Dimension(535, 440));
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel label1;
    private JButton startbutton;
    private JButton closebutton;
    private JButton skipRankbutton;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
